package com.lyl.controller;

import com.lyl.model.LoginResult;
import com.lyl.model.Result;
import com.lyl.service.SysLoginService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author lylbell
 * @date 2021-06-22 14:48
 */
@RestController
@Api(tags = "登录相关接口")
public class SysLoginController {

    @Autowired
    private SysLoginService sysLoginService;


    @PostMapping("/login")
    @ApiOperation(value= "后台系统登录")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "username",value = "登录账号"),
            @ApiImplicitParam(name = "password",value = "登录密码")
    })
    public LoginResult login(@RequestParam("username")String username, @RequestParam("password")String password) {
       return sysLoginService.login(username, password);
    }


}
